package response

type AnalyseData struct {
	CustomerType    []AnalyseItem `json:"customerType"`
	MaintenanceNum  []AnalyseItem `json:"maintenanceNum"`
	MaintenanceType []AnalyseItem `json:"maintenanceType"`
	VipLevel        []AnalyseItem `json:"vipLevel"`
	Env             []AnalyseItem `json:"env"`
	License         []AnalyseItem `json:"license"`
}

type Name struct {
	Name    string  `json:"name"`
	Version *string `json:"version,omitempty"`
}

type AnalyseItem struct {
	Value int    `json:"value"`
	Name  string `json:"name"`
	List  []Name `json:"list,omitempty"`
}

type CustomerType struct {
	Type  uint `gorm:"column:type"`
	Count int  `gorm:"column:count"`
}

type TechnicalSupport struct {
	Status uint `gorm:"column:service_status"`
	Count  int  `gorm:"column:count"`
}

type Env struct {
	Env         string `gorm:"column:env"`
	Count       int    `gorm:"column:count"`
	CustomerIds string `gorm:"column:customer_ids"`
}

type License struct {
	Active uint `gorm:"column:active"`
	Count  int  `gorm:"column:count"`
}

type MaintenanceType struct {
	Type  uint `gorm:"column:maintenance_type"`
	Count int  `gorm:"column:count"`
}
type VipLevel struct {
	Level uint `gorm:"column:vip_level"`
	Count int  `gorm:"column:count"`
}

type EnvCount struct {
}
type EnvAnalyse struct {
	Poc  [][]interface{} `json:"POC环境"`
	Prod [][]interface{} `json:"生产环境"`
	Uat  [][]interface{} `json:"UAT环境"`
	Test [][]interface{} `json:"测试环境"`
	Dev  [][]interface{} `json:"开发环境"`
	Sit  [][]interface{} `json:"SIT环境"`
}

type VipQuestionMalfun struct {
	Level       string `json:"level"`
	Question    int    `json:"question"`
	Malfunction int    `json:"malfunction"`
}

// OnesTask 结构体表示任务
type OnesTask struct {
	Deadline        interface{} `json:"deadline"`
	EstimatedHours  int         `json:"estimatedHours"`
	ImportantFields []Value     `json:"importantField"`
	IssueTypeScope  struct {
		UUID string `json:"uuid"`
	} `json:"issueTypeScope"`
	TaskType         string `json:"taskType"`
	Key              string `json:"key"`
	Name             string `json:"name"`
	Customer         string `json:"customer"`
	VipLevel         string `json:"vipLevel"`
	RemainingManhour int    `json:"remainingManhour"`
	Status           struct {
		Category string `json:"category"`
		Name     string `json:"name"`
	} `json:"status"`
	TotalEstimatedHours int    `json:"totalEstimatedHours"`
	UUID                string `json:"uuid"`
}

type OnesData struct {
	Data struct {
		Buckets []struct {
			Tasks []OnesTask `json:"tasks"`
		} `json:"buckets"`
	} `json:"data"`
}

type TaskDetailData struct {
	Data struct {
		Task struct {
			MNd2Svv8 Value `json:"_MNd2Svv8"` // 工单类型
			VgxCMzpr Value `json:"_VgxCMzpr"` // 客户名称
		} `json:"task"`
	}
}

type Value struct {
	Value string `json:"value"`
}

type WorkOrder struct {
	VipWorkOrderTime struct {
		Level    []string `json:"level"`    // VIP等级
		Lt30     []int    `json:"lt30"`     // 问题工单数量
		Gt30Lt90 []int    `json:"gt30Lt90"` // 故障工单数量
		Gt90     []int    `json:"gt90"`     // 故障工单数量
	}
	WorkOrderList struct {
		Zixun    WorkOrderDesc `json:"咨询"`
		Xunjian  WorkOrderDesc `json:"巡检"`
		Wendang  WorkOrderDesc `json:"文档"`
		Biangeng WorkOrderDesc `json:"变更"`
		Bushu    WorkOrderDesc `json:"部署"`
		Wenti    WorkOrderDesc `json:"问题"`
		Guzhang  WorkOrderDesc `json:"故障"`
		Peixun   WorkOrderDesc `json:"培训"`
		Xuqiu    WorkOrderDesc `json:"需求"`
	}
	ProblemsFailuresData []ProblemsFailures
}

type VipCostTime struct {
	Lt30     int `json:"lt30"`
	Gt30Lt90 int `json:"gt30Lt90"`
	Gt90     int `json:"gt90"`
}

type WorkOrderDesc struct {
	Total int               `json:"total"`
	Done  int               `json:"done"`
	Todo  int               `json:"todo"`
	List  []WorkOrderDetail `json:"list"`
}

type WorkOrderDetail struct {
	Title    string `json:"title"`
	Owner    string `json:"owner"`
	Customer string `json:"customer"`
	VipLevel string `json:"vipLevel"`
	Status   string `json:"status"`
	UUID     string `json:"uuid"`
}

type ProblemsFailures struct {
	Level string `json:"level"`
	Type  string `json:"type"`
	Total int    `json:"total"`
	VipCostTime
	Lt30Proportion     string `json:"lt30Proportion"`
	Gt30Lt90Proportion string `json:"gt30Lt90Proportion"`
	Gt90Proportion     string `json:"gt90Proportion"`
	TotalProportion    string `json:"totalProportion"`
}
